package pers.myutil.network.r;

/**
 * 返回数据
 * @param <T> 泛型数据
 */
public class ReturnData<T> {

    private int code;//返回状态
    private T data;//返回数据
    private String msg;//返回信息

    public ReturnData(ReturnCode returnCode,String msg){
        this.code = returnCode.getCode();
        this.msg = msg;
    }

    public ReturnData(ReturnCode returnCode,String msg,T data){
        this.code = returnCode.getCode();
        this.msg = msg;
        this.data = data;
    }

    public ReturnData(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public ReturnData(int code,String msg,T data){
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
